<?php

/*
 * Yanis Framework
 * @copyright Copyright (C) 2011 ch@rlesen. All rights reserved.
 * @license GNU/GPL
 * @author Charles EDOU NZE
 */

/**
 * Classe Registry
 *
 */
class Registry {

    /**
     * Array of objects
     */
    private $objects;

    /**
     * Array of settings
     */
    private $settings;

    public function __construct() {
        
    }

    /**
     * Create a new object and store it in the registry
     * @param String $object the object file prefix
     * @param String $key pair for the object
     * @return void
     */
    public function yStoreObject($object, $key) {
        require_once ($objects . '.class.php');
        $this->objects[$key] = new $object($this);
    }

    /**
     * Store settings
     * @param String $setting the setting data
     * @param String $key the key pair for the settings array
     * @return void
     */
    public function yStoreSetting($setting, $key) {
        $this->settings[$key] = $setting;
    }

    /**
     * Get an object from the registries store
     * @param String $key the objects array key
     * @return Object
     */
    public function getObject($key) {
        return $this->objects[$key];
    }

    /**
     * Get a setting from the registries store
     * @param String $key the settings array key
     * @return String the setting data
     */
    public function getSetting($key) {
        return $this->settings[$key];
    }

}

?>